import upload from '@/utils/upload'
import request from '@/utils/request'



export function getwechat(data) {
	return request({
		url: '/common/wechat',
		method: 'get',
		params: data
	})
}
export function getlist(data) {
	return request({
		url: '/common/list',
		method: 'get',
		params: data
	})
}
// 用户密码重置
export function updateUserPwd(oldPassword, newPassword) {
	const data = {
		oldPassword,
		newPassword
	}
	return request({
		url: '/api/system/user/profile/updatePwd',
		method: 'put',
		params: data
	})
}

// 修改密码
export function modifypassword(data) {
	return request({
		url: '/api/app/modifypassword',
		method: 'put',
		data: data
	})
}

// 查询用户个人信息
export function getUserProfile() {
	return request({
		url: '/api/system/user/profile',
		method: 'get'
	})
}
// 
export function getLoginConfig(data) {
	return request({
		url: '/api/useraccount/pages',
		method: 'get',
		params: data
	})
}
export function loginconfig(data) {
	return request({
		url: '/api/loginconfig/' + data,
		method: 'get',
	})
}

// 修改用户个人信息
export function updateUserProfile(data) {
	return request({
		url: '/api/system/user/profile',
		method: 'put',
		data: data
	})
}

// 添加家庭信息
export function addfamily(data) {
	return request({
		url: '/api/app/addfamily',
		method: 'post',
		data: data
	})
}

// 修改家庭信息
export function modifyfamily(data) {
	return request({
		url: '/api/app/modifyfamily',
		method: 'put',
		data: data
	})
}

//根据familyId查看家庭信息
export function getfamily(data) {
	return request({
		url: '/api/app/getfamily',
		method: 'get',
		params: data
	})
}

//根据familyId批量删除家庭信息
export function deletefamily(data) {
	return request({
		url: '/api/app/deletefamily',
		method: 'delete',
		data: data
	})
}


// 用户头像上传
export function uploadAvatar(data) {
	return upload({
		url: '/api/system/user/profile/avatar',
		name: data.name,
		filePath: data.filePath
	})
}

//心理专家列表接口
export function psychologistlist(data) {
	return request({
		url: '/api/apppsyteacher/pages',
		method: 'get',
		params: data
	})
}
//心理专家详情
export function apppsyteacher(data) {
	return request({
		url: '/api/apppsyteacher/' + data,
		method: 'get',
	})
}
// 添加预约
export function appointment(data) {
	return request({
		url: '/api/appappointment',
		method: 'post',
		data: data
	})
}
// 倾述留言
export function confidemessage(data) {
	return request({
		url: '/api/apppsyteacher/confidemessage',
		method: 'post',
		data: data
	})
}
